n = int(input())
ss = []
for _ in (range(n)):
    ss.append(int(input()))

dp = {}
res = []
max1 = 0
i = 1
cur = ss[0]
dp[ss[0]] = 0
start = [0]
while i < n:
    if ss[i] not in dp:
        dp[ss[i]] = i
    else:
        if dp[ss[i]] + 1 < n:
            start.append(dp[ss[i]] + 1)
